  package fr.doume.cli;
  public class Jvm2Cli
  {
    public static String Translate( String nom)
    {
      Jvm2Cli t = new Jvm2Cli();
      
      byte [] sid = t.TranslateNameIntoSid( nom);
      return  t.TranslateSidIntoName(sid);
    }
    ///////only to test
    public static native void Write(String bises);
    public static native char[] StringToArray( String send);
    public native String TranslateSidIntoName(byte[] sid);
    //////
    
    public static native void initFromJvm();
    public native byte[] TranslateNameIntoSid (String nom);   
    public static native int Accept_sec(byte[] token, byte[][]tokent_out, long authL, long[] authLArray, 
              String[] nom_out, byte[][] sids, boolean[][] presents, String[] ssp_out);
    public static native int Login(String name, String password, String[] nom_out, byte[][] sids, boolean[][] presents);
    public static native void FreeAuthenticator(long handle);
    
    static
    {
      String arch = System.getProperty("os.arch");
      if(arch.equals("x86"))
      {
        System.loadLibrary("j2cx86");
      }
      else{
        System.loadLibrary("j2cx64");
      }
      Jvm2Cli.initFromJvm();
    }

  }

